package com.timber.util;

import java.awt.Color;
import java.io.Serializable;
import java.sql.*;


/**
 *	adoptor class for SLDataObject
 *	provides default implementation of required methods
 */
public abstract class SLDataObjectAdaptor implements SLDataObject
{
	
	
	private SLColor foregroundColorCode;
	
	private SLColor backgroundColorCode;
	
	private SLColor sortBackgroundColorCode;
	
    public boolean load( ResultSet rs ) throws SQLException
    {
	return false;
    }

    public Object hashKey() { return null; }
    public String getDescr() { return null; }
    public String toString() { return hashKey().toString(); }
    public String listString() { return hashKey().toString(); }
    public long	getId() { return 0; }
  public Object getIdObj() { return null; }

    public boolean isPlaceHolderObject(){return false;} //used in SearchableComboBox to identify "bogus" objects
                                                        //like "SelectAll" or "SelectNone"

	/**
	 * @return the backgroundColorCode
	 */
	public SLColor getBackgroundColorCode() {
		return (backgroundColorCode != null ? backgroundColorCode : sortBackgroundColorCode);
	}

	/**
	 * @param backgroundColorCode the backgroundColorCode to set
	 */
	public void setBackgroundColorCode(SLColor backgroundColorCode) {
		this.backgroundColorCode = backgroundColorCode;
	}

	/**
	 * @return the foregroundColorCode
	 */
	public SLColor getForegroundColorCode() {
		return foregroundColorCode;
	}

	/**
	 * @param foregroundColorCode the foregroundColorCode to set
	 */
	public void setForegroundColorCode(SLColor foregroundColorCode) {
		this.foregroundColorCode = foregroundColorCode;
	}
	
	public void setSortBackgroundColorCode(SLColor sortBackgroundColorCode){
		this.sortBackgroundColorCode = sortBackgroundColorCode;
	}
	
	
	 public SLColor getForegroundColorCode( Object o, int c ) {
        return getForegroundColorCode();
     
	 }
	 
	 public SLColor getBackgroundColorCode( Object o, int c ) {
		 
		 return getBackgroundColorCode();
	 }

}
